Conversation
added 4 commits
March 11, 2026 15:08
- Add eslint.config.mjs with typescript-eslint + eslint-config-prettier - Add .prettierrc and .prettierignore (matching a3 config) - Add .markdownlint-cli2.jsonc - Add tsconfig.eslint.json (includes src/ and test/) - Add .tool-versions (nodejs 20) - Add .github/workflows/code-quality.yml - Update package.json: lint, format:check, test:coverage scripts + devDeps - Auto-format existing source files via prettier --write Note: existing source has lint violations that need follow-up fixes.
- Merge duplicate imports from openclaw/plugin-sdk across all tool files - Fix no-base-to-string: add toId() helper in event-router, type narrowing in webhook-handler - Fix no-redundant-type-constituents: unknown|undefined -> unknown - Refactor handleIssueUpdate (complexity 29->4): extract handleAssigneeChanges, handleStateChange, handlePriorityChange sub-functions - Refactor activate (complexity 23->7): extract resolvePluginConfig() - Refactor linear-view-tool execute (complexity 33->4): extract listViews, getView, createView, updateView, deleteView helpers - Refactor updateIssue (complexity 21->4): extract resolveUpdateInput() - Fix no-floating-promises: void handleAfterToolCall pattern - Fix no-await-in-loop: Promise.all in deactivate - Fix require-atomic-updates: capture debouncer before clearing activeDebouncer - Fix no-unsafe-argument: eslint-disable on registerHttpRoute cast - Fix restrict-template-expressions: cast action as string in view tool - Disable unsafe rules for test files (vitest vi.fn() returns any) - Add placeholder describe.todo for empty linear-api.test.ts
…event-router
- linear-api.test.ts (30 new tests, replaces empty placeholder):
- graphql(): no API key, correct HTTP headers/body, data return,
HTTP errors, GraphQL errors, missing variables
- resolveIssueId(): valid format, uppercase team key, invalid formats,
not found, caching behaviour, cache reset, independent caching
- resolveTeamId(): happy path, uppercase key, not found
- resolveStateId(): exact match, case-insensitive, multi-word,
not-found error lists available states
- resolveUserId(): by name, by email, not found
- resolveLabelIds(): multiple labels, case-insensitive, empty list,
not found, preserves input order
- resolveProjectId(): happy path, not found
- linear-issue-tool.test.ts (6 new tests in update describe block):
- appendDescription: appends to existing description with separator
- appendDescription: sets directly when flag is false (single API call)
- appendDescription: handles absent existing description (no prefix)
- labels: passes resolved IDs to mutation input
- dueDate: clears to null when empty string passed
- dueDate: sets value when date string passed
- event-router.test.ts (1 new test):
- triage state type → ignore (was missing from DEFAULT_STATE_ACTIONS coverage)
README.md: - Remove duplicate H1 (MD025); consolidate fork note into a blockquote - Add blank line before fenced code block inside list item (MD031) - Break 647-char paragraph into sentence-per-line (MD013, max 280) - Add missing trailing newline (MD047) .github/ISSUE_TEMPLATE/bug_report.md: - Convert all bold section headers to ### headings (MD036) - Add blank lines around list items (MD032)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds ESLint, Prettier, and markdownlint code quality checks to the repo, following the pattern established in generalui/a3.
What's added
eslint.config.mjs— TypeScript-ESLint flat config withtypescript-eslint/recommendedTypeChecked+eslint-config-prettierto disable conflicting rules.prettierrc—singleQuote, nosemi,trailingComma: all,printWidth: 120(matches a3).prettierignore— Excludesdist/,coverage/,*.md,*.yml,*.yaml.markdownlint-cli2.jsonc— Markdown linting config (line length 280, inline HTML allowlist)tsconfig.eslint.json— Extends the compiler config to includetest/**for type-checked linting.tool-versions—nodejs 20(matches existingpublish.yml).github/workflows/code-quality.yml— PR gate: markdown lint + prettier check + ESLint + vitest coverage; path-filtered so it only runs when relevant files changepackage.json— New scripts:lint,lint:project,lint:markdown,format,format:check,test:coverage; new devDeps:eslint,typescript-eslint,eslint-config-prettier,prettier,markdownlint-cli2,npm-run-all,@vitest/coverage-v8The CI will not pass until the following violations in the existing source are resolved. These are real issues surfaced by the new rules — they should be fixed in follow-up commits on this branch before merge.
src/event-router.tscomplexity(29/20),max-depth(5/4),no-base-to-string(×6),no-redundant-type-constituentssrc/index.tscomplexity(23/20),no-duplicate-imports,no-floating-promises,no-unsafe-argument,no-await-in-loop,require-atomic-updatessrc/tools/linear-view-tool.tscomplexity(33/20),no-duplicate-imports,restrict-template-expressionssrc/tools/linear-issue-tool.tscomplexity(21/20),no-duplicate-importssrc/tools/linear-comment-tool.tsno-duplicate-importssrc/tools/linear-project-tool.tsno-duplicate-importssrc/tools/linear-relation-tool.tsno-duplicate-importssrc/tools/linear-team-tool.tsno-duplicate-importssrc/tools/queue-tool.tsno-duplicate-importssrc/webhook-handler.tsno-base-to-string(×4)test/event-router.test.tsno-duplicate-importstest/tools/linear-comment-tool.test.tsno-unsafe-return,no-unsafe-assignment,no-unsafe-member-accessThe
no-duplicate-importsviolations are likely caused by separate value/type imports from the same module — these can be merged into a single import withimport { Foo, type Bar }syntax.The
complexityandmax-depthviolations indicate functions that should be refactored.The
no-base-to-stringviolations indicate TypeBox schema fields being used in template literals where the type isstring | object— these need explicit.toString()calls or type narrowing.